﻿CREATE TABLE [dbo].[Email] (
    [Id]                      INT           IDENTITY (1, 1) NOT NULL,
    [IdContaEmail]            INT           NULL,
    [IdTipoEmail]             INT           NULL,
    [IdGrupoEmail]            INT           NULL,
    [DisplayName]             VARCHAR (200) NULL,
    [EnviarEm]                DATE          NULL,
    [DestinatarioEmail]       VARCHAR (255) NULL,
    [DestinatarioDisplayName] VARCHAR (255) NULL,
    [Assunto]                 VARCHAR (150) NOT NULL,
    [Conteudo]                TEXT          NULL,
    [Html]                    VARCHAR (200) NULL,
    [DataInclusao]            DATETIME      NOT NULL,
    [DataAlteracao]           DATETIME      NOT NULL,
    [Ativo]                   BIT           NOT NULL,
    FOREIGN KEY ([IdContaEmail]) REFERENCES [dbo].[ContaEmail] ([Id]) ON DELETE NO ACTION ON UPDATE NO ACTION
);

